<?php
/**
 * Created by litong on Date: 2018/12/24 0024 上午 10:06
 */
class MyClass2 extends MyClass{
  // 可以对public 和 protect进行重定义,但是private不能
  protected $protected="Protected2";
  function printHello()
  {
    echo $this->public;
    echo $this->protected;
  }
}
$obj2=new MyClass2();
echo $obj2->public;
echo $obj2->printHello();
?>